#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
	int n = 0;
	scanf("%d", &n);
	int x = 100;
	while (x >= 1)
	{
		int k = 1, all = 0;
		do
		{
			int week = 0;
			for (int m = 0; m <= 6; m++)
			{
				int day = x + m * k;
				week = week + day;
			}
			all = week * 52;
			if (all == n)
			{
				printf("%d\n%d", x, k);
				return 0;
			}
			else if (all < n)
				k++;
		} while (all < n);
		x--;
		
	}
}